package com.yet.kotlinapp.api

import com.yet.kotlinapp.entity.BannerResponseInfo
import com.yet.kotlinapp.entity.LoginResponseInfo
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.GET
import retrofit2.http.POST

/**
 *
 * @ProjectName: Kotlin app
 * @Package: com.yet.kotlinapp.api
 * @ClassName: WangAndroidApi
 * @Description: java类作用描述
 * @Author: liys
 * @CreateDate: 2021/8/25 16:14
 * @UpdateUser: 更新者
 * @UpdateDate: 2021/8/25 16:14
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
interface WangAndroidApi {

    @POST("https://www.wanandroid.com/user/login")
    @FormUrlEncoded
    fun loginAction(@Field("username")user:String,
                         @Field("password")ps:String):Observable<LoginResponseInfo>

    @POST("https://www.wanandroid.com/user/register")
    @FormUrlEncoded
    fun registAction(@Field("username")user:String,
                    @Field("password")ps:String,@Field("repassword")ps2:String)
    :Observable<LoginResponseInfo>

    @GET("https://www.wanandroid.com/banner/json")
    fun getBannerAction():Observable<BannerResponseInfo>
}